<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>14、拟态特效</title>
</head>
<style>
  /** 拟态阴影*/
  :root {
   --white:#fff;
   --color-1:#e4ebf5;
   --color-2:#c8d0e7;
   --color-3:#9baacf;
   --box-shadow: inset 0.2rem 0.2rem 0.5rem var(--color-2), inset -0.2rem 0;
   --active-shadow: 0.3rem 0.3rem 0.6rem var(--color-2), -0.2rem -0.2rem 0.5; 
  }
  /*css自定义属性*/
  /*效果比较难调内阴影外阴影的应用 inset*/
  body{
    height: 100vh;
    display: flex;
    overflow: hidden;
    background:var(--color-1);
  }
  button{
    margin:auto;
    color:var(--color-3);
    outline: none;
    border: none;
    width: 150px;
    height: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    font-weight: 80;
    line-height: 40px;
  }
  button:active{
   box-shadow: var(--active-shadow);
  }
</style>
<body>
   <button>Button</button>
</body>
</html>